#pragma once

namespace refine {

struct alpha_copier {
	template <typename Color>
	void operator () (Color & c1, const Color & c2) const
		{ c1.a = c2.a; }
};

struct color_copier {
	template <typename Color>
	void operator () (Color & c1, const Color & c2) const
		{ c1.b = c2.b; c1.g = c2.g; c1.r = c2.r; }
};

template <typename R>
inline void copy_alpha(R & dst, R const & src)
	{ img::transform(dst, src, alpha_copier()); }

template <typename R>
inline void copy_color(R & dst, R const & src)
	{ img::transform(dst, src, color_copier()); }

} //namespace refine